/*
 * Decoder.h
 *
 *  Created on: 2011-2-26
 *      Author: hao
 */

#ifndef DECODER_H_
#define DECODER_H_

#include <functional>
#include <string>
#include <pulse/pulseaudio.h>

class Decoder{

	std::string patch;

	std::string prefixName;

	void * decoderHandle;

	bool( *CheckingFunction )( void *, unsigned long long );

	bool( * Decoding )( void *, size_t, size_t * );

	bool( * getSoundSampleStatus )( unsigned *, unsigned *, unsigned * );

	bool( * SetTrack )( int, int, int, int, int, int );
        
        bool( * Seek )( int , int , int );
        
        void ( *TotalTime )( int *, int *, int * );
        
        void ( *decoderinit )();
        
        void ( *decoderdestroy )();

public:

	Decoder( const char * szPatch );

	~Decoder();

        bool Init();

	bool( * getCheckingFunction() )( void *, unsigned long long );

	bool( * getSoundStatusFunction() )( unsigned *, unsigned *, unsigned * );

	bool( * getDecodingFunction() )( void *, size_t, size_t * );

	bool( * getSetTrack() )( int, int, int, int, int, int );
        
        bool( * getSeek() )( int, int, int );
        
        void ( * getTotalTime() )( int *, int *, int * );

	const std::string & getPrefixName() const;

};


#endif /* DECODER_H_ */
